package org.jeecg.modules.basic.warehouseline.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang.StringUtils;
import org.jeecg.modules.basic.warehouseline.entity.WmsMesLineWarehouseMap;
import org.jeecg.modules.basic.warehouseline.mapper.WmsMesLineWarehouseMapMapper;
import org.jeecg.modules.basic.warehouseline.service.IWmsMesLineWarehouseMapService;
import org.springframework.stereotype.Service;

/**
 * @Description: 仓库组
 * @Author: jeecg-boot
 * @Date: 2023-08-02
 * @Version: V1.0
 */
@Service
public class WmsMesLineWarehouseMapServiceImpl extends ServiceImpl<WmsMesLineWarehouseMapMapper, WmsMesLineWarehouseMap> implements IWmsMesLineWarehouseMapService {

    @Override
    public String getWarehouseIdBySite(String site) {
        String warehouseId = "";
        if (StringUtils.isNotBlank(site)) {
            WmsMesLineWarehouseMap wmsMesLineWarehouseMap = this.getOne(new LambdaQueryWrapper<WmsMesLineWarehouseMap>().eq(WmsMesLineWarehouseMap::getSite, site));
            if (ObjectUtil.isNotNull(wmsMesLineWarehouseMap)) {
                warehouseId = wmsMesLineWarehouseMap.getWarehouseId();
            }
        }
        return warehouseId;
    }
}
